home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / BARNET / FREENET / JONES / LOGIN / doc / login next >
Text File  |  1995-08-29  |  5KB  |  114 lines

  1. Readme file for login.
  2.  
  3. This program is Copyright (C) 1994,1995 Alun Jones, auj@aber.ac.uk
  4. It is freeware, which means you can copy it freely, on the condition that
  5. you don't charge more than a nominal fee for the distribution media. You're
  6. welcome to make changes to the source code, recompile it, or whatever. I'd
  7. like to keep track of any interesting additions, and am happy to receive bug
  8. reports.
  9.  
  10. Instructions for login
  11.  
  12.  Login is a clone of the Unix login program. It is a command-line program and
  13.  is intended to be placed within your bootup sequence before the desktop
  14.  starts. At this early point, it is possible to stop (clueless) people from
  15.  accessing facilities on your machine without logging in.
  16.  
  17.  Login prompts for a username (if not passed on the command line) and
  18.  password. It then encrypts this password and compares it with the stored
  19.  value in /etc/passwd. If this is the same then it assumes that the user is
  20.  who they say they are and proceeds to perform a number of actions:
  21.  
  22.  1. It sets the system variable, USER to be the entered username. This
  23.     variable is made read-only using a code variable. Making variables
  24.     readonly is not a foolproof protection by any means, but it makes it a
  25.     little more difficult to change username without validations.
  26.  
  27.  2. Similarly, the system variables, Unix$uid and Unix$gid are set from the
  28.     values in the password file. These are used internally by some UnixLib
  29.     programs.
  30.  
  31.  3. NAME is set from the password file entry. This is not made read-only by
  32.     default, but see later.
  33.  
  34.  3. HOME is set, again from the password file entry, to the user's home
  35.     directory. The user root directory (URD) is also set to this value.
  36.  
  37.  4. If a file matching (*) the name "/etc/loginrc" exists, then this file is
  38.     executed. The intention is that this should be an obey file containing
  39.     commands which should by run when all users login.
  40.     (*) "matching" indicates that the standard UnixLib mappings apply. See
  41.     below.
  42.  
  43.  5. The current working directory (CWD) is set to the URD. If a file
  44.     matching the name ".login" exists, then this file is executed. Again,
  45.     the intention is that this should be an obey file.
  46.  
  47.  6. If a file matcing the name <Mail$Dir>/user (where user is the username)
  48.     exists, then "You have mail" is printed.
  49.  
  50.  7. If the pw_shell field for the user starts with an *, then this field is 
  51.     immediately run. For example, I have the following line in my passwd
  52.     file:
  53.  
  54.     shutdown::4:0:System Shutdown:/:*shutdown
  55.  
  56.     So, if I reboot, but don't want to wait for the desktop to start, I can
  57.     login as shutdown, with no password. This will cause the machine to
  58.     shutdown.
  59.  
  60. UnixLib requirements.
  61.  
  62.  The program was written using the UnixLib library, and Paul Moore's Utils
  63.  library for the fcrypt function. Therefore, pathnames are translated from
  64.  Unix conventions to RISC OS conventions.
  65.  
  66.  This affects matters in three ways:
  67.  1. The directory, /etc, will be searched for as $.etc on the current
  68.     filing system unless the variable UnixFS$/etc is set. My setup uses
  69.      Set UnixFS$/etc SCSI::Scuzzy.$.etc
  70.     to indicate the relevant directory.
  71.  
  72.  2. ".login" maps to the RISC OS name, "/login".
  73.  
  74.  3. Home directories *must* be specified in the Unix way. Since the passwd
  75.     file uses : as a field seperator, a home directory of
  76.      SCSI::Scuzzy.$.home.auj
  77.     cannot be stored. Rather, I use /home/auj, and have a UnixFS$/home
  78.     variable referring to the true home directory. Note that login translates
  79.     this directory to the appropriate RISC OS name before storing it in the
  80.     HOME system variable.
  81.  
  82.  One other UnixLib consideration: The gethostname() function in standard
  83.  UnixLib merely returns "acornXX", where XX is the hexadecimal Econet
  84.  station number. This is pretty boring, so login first reads the HOST system
  85.  variable. If this is set, its value is used instead as the machine name.
  86.  
  87. The /etc/loginrc file.
  88.  
  89.  As mentioned above, this file, if it exists, will be run before the user's
  90.  own .login file. You can therefore run commands for the user as they login.
  91.  At the point where it is run, all the variables normally set by login have
  92.  been set, as has the URD. This file can be used to set any other
  93.  user-specific variables before the user can get to them. You can use the
  94.  "readonly" utility to prevent the user from changing them, if you want.
  95.  Note, however, that once a variable is made readonly, it stays that way. So
  96.  a second invokation of login will fail to set any variables made readonly
  97.  in this file. (login itself can make variables writeable, so USER etc.
  98.  can be re-written. But supplying a utility to reverse the effects of
  99.  readonly would make readonly itself a little pointless ;-)
  100.  
  101.  The /etc/loginrc can be used to avoid having seperate directories for
  102.  seperate users, if this is desired. If you think it's better to have a
  103.  single directory full of users' login scripts, you could do something like
  104.  the following:
  105.  
  106.  | /etc/loginrc
  107.  
  108.  | System wide login stuff
  109.  
  110.  Run SCSI::Scuzzy.$.profiles.<USER>
  111.  
  112.  Each user could then have an obey file in $.profiles, named after their
  113.  user-id.
  114.